package 测试;

import java.util.ArrayList;
import java.util.Scanner;
import java.util.Stack;

/**
 * Created by hest0 on 2017/7/5.
 */

public class 游戏24点 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            //输入4个数据
            String[] a = sc.nextLine().split("\\s+");
            int[] num = new int[a.length];
            for (int i = 0; i < a.length; i++) {
                num[i] = Integer.valueOf(a[i]);
            }
            //计算所有的运算符组合，计算中序表达式，判断是不是24点
            int res = 0;
            String exp = null;
            ArrayList<String> oper = getOper();
            for (String anOper : oper) {
                exp = null;
                exp = num[0] + String.valueOf(anOper.charAt(0)) + num[1] + String.valueOf(anOper.charAt(1)) + num[2] + String.valueOf(anOper.charAt(0)) + num[3];
                res = calcFunc(exp);
                if (res == 24) {
                    break;
                }
            }
            if (res == 24) {
                System.out.println(exp);
            } else {
                System.out.println("None");
            }
        }
        sc.close();
    }

    /**
     * 计算中序符号表达式
     *
     * @param exp
     * @return
     */
    private static int calcFunc(String exp) {
        ArrayList<String> inOrderList = exp2InOrderList(exp);
        ArrayList<String> postOrderList = inOrder2PostOrder(inOrderList);
        Integer result = calculatePostOrder(postOrderList);
        return result;
    }

    /**
     * 计算后缀表达式
     *
     * @param postOrderList
     * @return
     */
    private static Integer calculatePostOrder(ArrayList<String> postOrderList) {
        Stack<Integer> stack = new Stack<>();
        for (String s : postOrderList) {
            char c = s.charAt(0);
            //如果是数字的就入栈
            if (Character.isDigit(c) || (s.length() > 1 && c == '-')) {
                stack.push(Integer.parseInt(s));
            } else {
                //如果是符号就计算
                Integer num2 = stack.pop();
                Integer num1 = stack.pop();
                Integer tmpRes = 0;
                switch (c) {
                    case '+':
                        tmpRes = num1 + num2;
                        break;
                    case '-':
                        tmpRes = num1 - num2;
                        break;
                    case '*':
                        tmpRes = num1 * num2;
                        break;
                    case '/':
                        tmpRes = num1 / num2;
                        break;
                }
                stack.push(tmpRes);
            }
        }
        return stack.pop();
    }

    /**
     * 中序表达式转化成后序表达式
     *
     * @param inOrderList
     * @return
     */
    private static ArrayList<String> inOrder2PostOrder(ArrayList<String> inOrderList) {
        ArrayList<String> resList = new ArrayList<>();
        Stack<String> stk = new Stack<>();
        for (String s : inOrderList) {
            //判断首字符是不是数字和减号
            char c = s.charAt(0);
            if (Character.isDigit(c) || (s.length() > 1 && c == '-')) {
                resList.add(s);
            } else {
                switch (c) {
                    case '(':
                        stk.push(s);
                        break;
                    case ')':
                        while (!stk.peek().equals("(")) {
                            resList.add(stk.pop());
                        }
                        //删除栈中的"("
                        stk.pop();
                        break;
                    default:
                        //运算符入栈的时候要考虑优先级，优先等级低的可以入栈
                        while (!stk.isEmpty() && compareSymb(stk.peek(), s)) {
                            resList.add(stk.pop());
                        }
                        //符号入栈
                        stk.push(s);
                        break;
                }
            }
        }
        while (!stk.isEmpty()) {
            resList.add(stk.pop());
        }
        return resList;
    }

    /**
     * 比较字符串的优先级
     *
     * @param peek
     * @param cur
     * @return
     */
    private static boolean compareSymb(String peek, String cur) {
        if ("*".equals(peek) && ("/".equals(cur) || "*".equals(cur) || "+".equals(cur) || "-".equals(cur)))
            return true;
        else if ("/".equals(peek) && ("/".equals(cur) || "*".equals(cur) || "+".equals(cur) || "-".equals(cur)))
            return true;
        else if ("+".equals(peek) && ("+".equals(cur) || "-".equals(cur)))
            return true;
        else if ("-".equals(peek) && ("+".equals(cur) || "-".equals(cur)))
            return true;
        return false;
    }

    /**
     * 将常规表达式拆解成中序表达式
     *
     * @param str
     * @return
     */
    private static ArrayList<String> exp2InOrderList(String str) {
        ArrayList<String> resList = new ArrayList<>();
        StringBuilder numSb = new StringBuilder();
        char pre = '(';
        for (int i = 0; i < str.length(); i++) {
            char c = str.charAt(i);
            //判断数字和减号
            if (Character.isDigit(c) || c == '-') {
                //如果是减号
                if (c == '-' && (Character.isDigit(pre) || pre == ')')) {
                    //清空准备单独放一个字段
                    if (numSb.length() != 0) {
                        resList.add(numSb.toString());
                        numSb.setLength(0);
                    }
                    //单独放减号
                    resList.add(String.valueOf(c));
                } else {
                    //如果不是减号是数字直接叠加在中间sbNum
                    numSb.append(c);
                }
            } else {
                //清空上一个字段，准备放下一个字段
                if (numSb.length() != 0) {
                    resList.add(numSb.toString());
                    numSb.setLength(0);
                }
                //不是数字和减号直接加入结果
                resList.add(String.valueOf(c));
            }
            //表示当前字符的前一个字符
            pre = c;
        }
        if (numSb.length() != 0) {
            resList.add(numSb.toString());
            numSb.setLength(0);
        }
        return resList;
    }

    /**
     * 计算所有的运算符组合
     *
     * @return
     */
    private static ArrayList<String> getOper() {
        ArrayList<String> oper = new ArrayList<>();
        String s = "+-*/";
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 4; j++) {
                for (int k = 0; k < 4; k++) {
                    oper.add(String.valueOf(s.charAt(i)).concat(String.valueOf(s.charAt(j))).concat(String.valueOf(s.charAt(k))));
                }
            }
        }
        return oper;
    }
}
